/**
 * @param {string} s
 * @return {number}
 */
export var myAtoi = function (s) {
  s = Number(s.trim().replace(/([+-]?\d+).*/, '$1'))
  return isNaN(s) ? 0 : Math.max(-(2 ** 31), Math.min(s, 2 ** 31 - 1))
}
